﻿using System.Windows;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;

namespace TradeMo
{
    public partial class About : PhoneApplicationPage
    {
        public About()
        {
            InitializeComponent();
			if (!App.IsTrial)
				BuyButton.Visibility = Visibility.Collapsed;

            DataContext = this;
        }

        private void ResetCatalogButton_Click(object sender, RoutedEventArgs e)
        {
            App.TradeMe.Catalog.Reset();
            MessageBox.Show("Restart TRADE MObile to reload catalog");
        }

        private void BuyButton_Click(object sender, RoutedEventArgs e)
        {
            var detailTask = new MarketplaceDetailTask();
            detailTask.Show();
        }

        private void SupportButton_Click(object sender, RoutedEventArgs e)
        {
            var email = new EmailComposeTask {To = "TradeMo@DrDevelop.com", Subject = "TradeMObile is ..."};
            email.Show();
        }

        public bool HideBackground
        {
            get { return App.Model.Setup.HideBackground; }
            set { App.Model.Setup.HideBackground = value; }
        }
    }
}